package cn.yyh.serviceOrder.service.impl;

import cn.yyh.commons.service.impl.MyBaseServiceImpl;
import cn.yyh.commons.utils.PageInfo;
import cn.yyh.commons.utils.R;
import cn.yyh.serviceOrder.domain.ProductOrder;
import cn.yyh.serviceOrder.domain.ProductOrderDetail;
import cn.yyh.serviceOrder.mapper.ProductOrderDetailMapper;
import cn.yyh.serviceOrder.service.IProductOrderDetailService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class ProductOrderDetailServiceImpl extends MyBaseServiceImpl<ProductOrderDetailMapper, ProductOrderDetail> implements IProductOrderDetailService {


    @Override
    public List<ProductOrder> getByOrderId(List<ProductOrder> rows) {
        for (int i = 0; i < rows.size(); i++) {
            ProductOrder order = rows.get(i);
            ProductOrderDetail detail = baseMapper.getByOrderId(order.getId());
            order.setDetail(detail);
        }
        return rows;

    }
}
